package models

import "gorm.io/gorm"

type Shops struct {
	gorm.Model
	Name    string `gorm:"type:varchar(20);not null;unique" json:"name"`
	Address string `gorm:"type:varchar(20);not null" json:"address"`
}

func (s *Shops) Add() error {
	return DB.Create(&s).Error
}
func (s *Shops) GetList() (shop []*Shops, err error) {
	err = DB.Find(&shop).Error
	return shop, err
}
func (s *Shops) Update() error {
	return DB.Updates(&s).Error
}
